Repository navigation
feat(ENG-15367): label runs made by AI coding agents - #573
Draft
tigh-latte wants to merge 1 commit into
Draft
tigh-latte wants to merge 1 commit into
tigh-latte wants to merge 1 commit into
Conversation
A run gets persona "agent" when the environment shows an AI coding agent ran the command. Only markers that agents set for the commands they run are read (Claude Code, Codex CLI, Gemini CLI, Copilot, then AI_AGENT); markers that IDEs also set in a person's own terminal are ignored. A new "agent" property carries a name defined in code, never the variable's value, and unknown AI_AGENT values become "unidentified_agent". Agent wins the persona even in CI; ci and ci_provider stay as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR labels runs made by AI coding agents. When the environment shows that an agent ran the command, the event gets
persona: agentand a newagentproperty with a name defined in code. It is kept separate from the rest of the stack so it can be reviewed, or left out, on its own.agentCLAUDE_CODE_CHILD_SESSIONclaude_codeCODEX_THREAD_IDcodexGEMINI_CLIgemini_cliCOPILOT_AGENT,COPILOT_CLI,COPILOT_AGENT_SESSION_IDcopilotAI_AGENTwith a known prefix (claude-code,github_copilot,codex,gemini,opencode)AI_AGENTwith any other valueunidentified_agentCLAUDECODE,CURSOR_TRACE_ID,REPL_ID,TERM_PROGRAM,COPILOT_MODEL) are ignored, because reading them would label people as agents.ciandci_providerstay as they are, so both are visible.There's no
CLOUDSMITH_AGENTvariable for declaring or overriding the label. Detection is a best-effort label, and a variable that lets a caller say it isn't an agent would add an interface without making the label more trustworthy.Type of Change
Additional Notes
N/A: no change for runs without an agent marker.
🤖 Generated with Claude Code